package com.lianxi.nmms.service;

import com.github.pagehelper.PageInfo;
import com.lianxi.nmms.entity.Product;
import com.lianxi.nmms.entity.ProductType;
import com.lianxi.nmms.exception.*;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpSession;
import java.io.File;
import java.util.List;

/**
 * 翔哥
 * 2025年09月29日
 */
public interface ProductService {

    //分页
    PageInfo<Product> findPage(String pageNo, String pageSize);

    List<Product> findAll();

    //添加
    void addProduct(String name, String price , String description ,CommonsMultipartFile  file , String typeId, HttpSession session) throws RequestParameterErrorException, ProductTypeExistException, FileUploadErrorException, ProductExistException;


    //找到修改的商品
    Product findProductById(String id) throws RequestParameterErrorException;
    //修改商品
    void updateProduct(String id,String name, String price , String description ,CommonsMultipartFile  file , String typeId, HttpSession session) throws RequestParameterErrorException, ProductTypeExistException, ProductExistException, FileUploadErrorException;

    //删除商品
    void deleteProduct(String id,HttpSession session) throws ProductExistException, FileDeletionErrorException, ProductDeletionErrorException;
}
